// 这个接口是插件用的
const point = require("../models/point")

var express = require('express');
var router = express.Router();

const formidable = require('formidable');

router.post('/', (req, res, next) => {
    var form = new formidable.IncomingForm();
    form.parse(req, function (err, fields, files) {
        if (err) {
            res.json({ 'state': false })
        } else {
            point.findOne({
                _id: fields.id
            },  (error, doc) => {
      
                if (error) {
                    res.json({ 'state': false, 'msg': error });
                } else {
                    res.json({ 'state': true, 'result':doc });
                }
            })

        }

    });

});

module.exports = router;